package com.zhixing.reward.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.zhixing.common.domain.entity.CouponUseInfo;
import com.zhixing.reward.domain.dto.QueryParams;
import com.zhixing.reward.domain.entity.Coupon;
import com.zhixing.reward.domain.vo.CouponRecordVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.math.BigDecimal;
import java.util.List;

@Mapper
public interface CouponMapper extends BaseMapper<Coupon> {

    List<CouponRecordVO> getUnusedCoupon(Integer id);

    List<CouponRecordVO> getInvalidCouponByPage(@Param("queryParams") QueryParams queryParams, @Param("id") Integer id);

    List<CouponRecordVO> getCanUseCouponByAmount(Integer userId, BigDecimal amount);

    CouponUseInfo getCouponUseInfoById(Integer couponId, Integer userId);
}
